﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Text;
using System.Threading.Tasks;


namespace JXC.Core.Models
{
    /// <summary>
    /// 采购退货单主文件
    /// </summary>
    public class CaigouReturned
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public Guid Id { get; set; }//采购退货单单号

        [ForeignKey("SupplierId")]
        public Guid SupplierID { get; set; }//供货商
        public string Monetary { get; set; }//货币
       
        public DateTime ReturnedDate { get; set; }//退货日期

        [ForeignKey("UserInfosId")]
        public Guid ShipperID { get; set; }//发货人    发起退货的人

        [ForeignKey("UserInfosId")]
        public Guid OperatorID { get; set; }//操作员

        public DateTime EnterDate { get; set; }//录入日期

        [ForeignKey("UserInfosId")]
        public Guid? OpmanID { get; set; }//修改人
        public DateTime? OpDate { get; set; }//修改日期

        [ForeignKey("UserInfosId")]
        public Guid? ExaminerID { get; set; }//审核人
        public DateTime? ExamineDate { get; set; }//审核日期

        public string Others { get; set; }//备注
        public int ExamineState { get; set; }  //审核状态
        public ICollection<ReturnedDetail> ReturnedDetails { get; set; } = new List<ReturnedDetail>();
      
        public UserInfos Shipper { get; set; }
        public UserInfos Operator { get; set; }
        public UserInfos Examiner { get; set; }
        public Supplier Supplier { get; set; }

    }
}
